package com.edgar;
import io.grpc.Server;
import io.grpc.ServerBuilder;

import java.io.IOException;

/**
 * @author liqs
 * @version 1.0
 * @date 2020/12/31 16:23
 */
public class GrpcServer {

    private static final int port = 9999;
    public static void main(String[] args) throws IOException, InterruptedException {

        Server server = ServerBuilder.
                forPort(port)
                .addService( new RPCDateServiceImpl() )
                .build().start();
        System.out.println( "grpc服务端启动成功, 端口=" + port );
        server.awaitTermination();

    }
}
